package com.yusys.jin.blog;

import java.util.ArrayList;
import java.util.List;

import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringRunner;

import com.yusys.jin.blog.configuration.MenuConfig;
import com.yusys.jin.blog.entity.commonEntity.District;
import com.yusys.jin.blog.entity.commonEntity.ServerArea;
import com.yusys.jin.blog.entity.commonEntity.ServerServer;
import com.yusys.jin.blog.mapper.CommonInfoMapper;

@RunWith(SpringRunner.class)
@SpringBootTest
public class CommonTestCase {

    @Autowired
    CommonInfoMapper mapper;
    @Autowired
    MenuConfig config;

    @Test
    public void findArea() {
        List<ServerArea> list = new ArrayList<ServerArea>();
        list = mapper.findAllArea();
        System.err.println(list);
    }

    @Test
    public void findAllServer() {
        List<ServerServer> list = new ArrayList<ServerServer>();
        list = mapper.findAllServer(2);
        System.err.println(list);
    }

    @Test
    public void findDistrict() {
        List<District> list = new ArrayList<District>();
        list = mapper.findAllDistric(3);
        System.err.println(list);
        for (District d : list) {
            System.err.println(d);
        }
    }

    @Test
    public void test() {
        System.out.println(config.getMap());
    }

}
